<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStoresTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('stores', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->bigInteger('agent_id')->index()->comment('代理ID');
            $table->string('name', 32)->comment('门店名称');
            $table->string('mobile', 16)->comment('负责人手机号');
            $table->string('divide_account', 32)->default('')->comment('门店分账账号');
            $table->decimal('agent_service_fee_rate')->default(0)->comment('代理手续费费率');
            $table->boolean('is_default')->default(false)->comment('是否是默认门店');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('stores');
    }
}
